<script language="javascript">
function check(){
	var checked_num = 0;
	var obj = document.getElementsByName("id[]");
	var len = obj.length;
	
	for(i=0;i<len;i++){
		if(obj[i].checked == true){
			checked_num++;
			}
		}
	if(checked_num == 0){
		alert("请选择再删除！");
		return false;}
	else{
		if(window.confirm("确定删除？")){
			document.form.submit();
		}else{
			return false;
			}
		}
}
</script>
<td id="mainarea">
<div id="nav">
当前位置: <a href="?action=default">管理首页</a> <span>&gt;</span> <a href="?action=recommendlist">推荐位置管理</a> <span>&gt;</span> <font color="red;">［<?=$lname?>］</font>推荐列表
</div>
<div class="block">
<form id="form" name="form" method="post" action="?action=recommend&op=del">
<table width="100%" border="0" align="center">
  <tr>
    <td width="50"><input type="checkbox" name="chkall" onclick="checkall(this.form);" />全选</td>
    <td width="350">标题</td>
    <!--td width="50">是否显示</td-->
	<td width="50">发布时间</td>
	<td width="55">&nbsp;</td>
  </tr>
  <? foreach($recommend as $recom){?>
  <tr>
    <td><input type="checkbox" name="id[]" value="<?=$recom['id']?>" /><input name="img_old[<?=$recom['id']?>]" type="hidden" value="attachments<?=$recom['img']?>" /></td>
    <td><a href="<?=$recom['url']?>" target="_blank"><?=$recom['subject']?></a></td>
    <!--td><{if $indexrecommend[i].isdisplay}><span style="color:#006600">已显示</span><{else}><a href="indexrecommend.php?action=audit&id=<{$indexrecommend[i].id}>" style="color:#FF0000" title="点击审核通过">未审核</a><{/if}></td-->
	<td><?=date("Y-m-d", $recom['pubtime'])?></td>
	<td><div align="center">[<a href="?action=recommend&op=edit&id=<?=$recom['id']?>">编辑</a>]</div></td>
  </tr>
  <? }?>
  <tr>
    <td colspan="5"><button value="true" type="submit" class="submit" name="Submitted" title="删除" onclick="check();" <? if ($recommend == null){?>disabled<? }?>>删除</button>
	</td>
  </tr>
</table>
</form>
</div>